// DlgItemUI.cpp : implementation file
//
#include "stdafx.h"
#include "DlgItemUI.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgItemUI dialog
//////////////////////////////////////////////////////////////////////////

CDlgItemUI::CDlgItemUI(TTAGDSITEM* pItem,CWnd* pParent/*=NULL*/)
	: CDialog(CDlgItemUI::IDD, pParent)
{
	m_pItem = pItem;
}
void CDlgItemUI::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CDlgItemUI, CDialog)

END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgItemUI message handlers
void CDlgItemUI::OnCancel()
{
	//CDialog::OnCancel();
}

BOOL CDlgItemUI::OnInitDialog() 
{
	CDialog::OnInitDialog();
	GetClientRect(&m_rcClient);

	CString csData;
	csData.Format("%d",m_pItem->n[0]);
	GetDlgItem(IDC_EDIT_ADDR)->SetWindowText(csData);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgItemUI::OnApply()
{
	CString csData;
	GetDlgItem(IDC_EDIT_ADDR)->GetWindowText(csData);
	m_pItem->n[0] = atoi(csData);
}

void CDlgItemUI::OnOK() 
{
	// TODO: Add extra validation here
	//CDialog::OnOK();
}
